package com.longrise.co.ui.mine.adapter;


import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.longrise.co.R;
import com.longrise.co.ui.mine.model.MineComplaintBean;
import com.longrise.co.utils.Constants;
import com.ly.common.baserx.RxBus;

import java.util.List;


/**
 * Created by admin on 2017/2/4.
 */

public class ComplaintAdapter extends BaseQuickAdapter<MineComplaintBean.ListBean> {

    public ComplaintAdapter(List<MineComplaintBean.ListBean> listData) {
        super(R.layout.item_mine_complaint, listData);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, final MineComplaintBean.ListBean data) {

        baseViewHolder.setText(R.id.card_num,  data.getCarno())
                .setText(R.id.name, data.getCompany())
                .setText(R.id.irr_normal_maintain_value, data.getRepairtype())
                .setText(R.id.irr_mileage_value, data.getRepairmile() + "KM")
                .setVisible(R.id.is_solve, "1".equals(data.getValuateflag()) ? true : false)
                .setOnClickListener(R.id.repair_detail, new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        //投诉详情
                        RxBus.getInstance().post(Constants.RX_EVENT_COMPLAINT_DETAIL, data);
                    }
                });

    }


}
